# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-ijson
pkgver=3.3.0
pkgrel=0
pkgdesc="Iterative JSON parser with standard Python iterator interfaces"
url="https://github.com/ICRAR/ijson"
arch="all"
license="BSD-3-Clause"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	yajl-dev
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/ICRAR/ijson/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/ijson-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
d2f54d4dae25328b2173f0e0f5c83853c77f59ce5f133ca21f4d06b18e62517aafe9062c027b054a98e84d889656956f79f27c1b9b173360ab20c1af85c22f1d  py3-ijson-3.3.0.tar.gz
"
